package bavaria.hightech.banking.bank;

import java.util.HashMap;

import bavaria.hightech.banking.exceptions.BankDoesNotExistException;

/**
 * class BankRegistry
 * @author David
 *
 */
public class BankRegistry {

	private static HashMap<String, B2B> b2b = new HashMap<String, B2B>();

	/**
	 * default-constructor
	 */
	private BankRegistry() {
	}

	/**
	 * put the bank to the HashMap
	 * @param name
	 * @param bank
	 * @return
	 */
	public static B2B bind(String name, B2B bank) {
		return b2b.put(name, bank);
	}

	public static B2B lookup(String name) throws BankDoesNotExistException {
		if (b2b.get(name) != null)
			return b2b.get(name);
		else
			throw new BankDoesNotExistException("");
	}

}
